home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1988 / Oct⁄Nov 88 / Re- Double-clicks ⁄ 11.18.88 ⁄ < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.1 KB  |  35 lines  |  [TEXT/GEOL]

  1. Item    0876043                         18-Nov-88        16:35
  2.  
  3. From:   CREMER.M                        Cremer, Mike
  4.  
  5. To:     D2078                           AS & M, Dev, Alan Dail
  6.         RODSETH.R                       Rodseth, Richard
  7.  
  8. cc:     MACAPP.TECH$                    MACAPP Tech
  9.  
  10. Sub:    re: double-clicks
  11.  
  12. Here's the cheap and sleazy Cremer way, where fDialog is set to be the owning
  13. dialog for the TTextListView object:
  14.  
  15. FUNCTION TMyTextListView.DoMouseCommand(VAR theMouse: Point; VAR info:
  16. EventInfo; VAR hysteresis: Point): TCommand; OVERRIDE;
  17.  
  18. BEGIN {DoMouseCommand}
  19.        DoMouseCommand := gNoChanges;          {assume we got it}
  20.        IF (gClickCount = 2) THEN
  21.         fDialog.DismissDialog('ok  ')     {pretend user hit OK}
  22.     ELSE
  23.            DoMouseCommand := INHERITED DoMouseCommand(theMouse,info,hysteresis)
  24. END; {DoMouseCommand}
  25.  
  26. It may not be elegant, but it works.  Warning, gClickCount can really mess
  27. things up if you have some other "do" action item (i.e. highlighting) because
  28. gClickCount gets incremented for triple-clicks as well.
  29.  
  30. $mike cremer
  31.  
  32.  
  33.  
  34.  
  35.